package com.huawei.su;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class BM52 {
    public static void main(String[] args) {
        int[] nums = {1,1,2,3,3,4};
        FindNumsAppearOnce (nums);
    }
    public static int[] FindNumsAppearOnce (int[] nums) {
        // write code here
        int[] r = new int[2];

        Map<Integer,Integer> map = new HashMap<>();
        for (int i = 0; i < nums.length; i++) {
            if(map.containsKey(nums[i])){
                map.remove(nums[i]);
                continue;
            }else {
                map.put(nums[i],1);
            }
        }
        Iterator<Integer> iterator = map.keySet().iterator();
        r[0]= iterator.next();
        r[1]= iterator.next();
        return r;
    }
}
